/*River Warren
 *October 15, 2011
 *
 *Inventory.h
 *Inventory object to be used by the game Dungeons and Princesses
 */

#ifndef INVENTORY_H_INCLUDED
#define INVENTORY_H_INCLUDED

#include <vector>
#include <map>
#include <iostream>
#include "Base.h"
#include "Key.h"
#include <typeinfo>
#include "EquipmentType.h"
#include "Potion.h"

#define DELIMS ",\n"
#define MAX 250

using std::map;
using std::vector;
using std::make_pair;
using namespace std;

class Listing //a single listing in the manifest
{
public:
    string objectType;
    int objectID;
    string description;
};

class Inventory
{
public:
    Inventory(){numOfItems = 0;}
    void add(Base*); //add something to the inventory
    //get a list of what's in the inventory
    //this list is a const pointer
    vector<Listing>const * getManifest(){return &manifest;}
    int getNumOfItems(){return numOfItems;}
    
    Key* getKey(int); //get a key out of inventory
    EquipmentType * getEquipmentType(int thisID); //get a eqipment type object (sword, helmet etc).
    Potion * getPotion(int thisID); // get a potion type object
    
protected:
    int numOfItems;
    map<int, Base*> items; //this map is the actual inventory
    vector <Listing> manifest; //this is a list of what's in the inventory
    void deleteFromManifest(int); //delete item from manifest that has been pulled out of inventory
    
private:
    
    
    friend ostream& operator<<(ostream& out, Inventory& inv);
    friend istream& operator>>(istream& in, Inventory& inv);
};

#endif /*INVENTORY_H_INCLUDED*/
